package com.timing.finder.framework;

import com.timing.finder.util.DateUtils;
import lombok.Getter;
import lombok.Setter;

import java.text.ParseException;
import java.util.Date;

/**
 * @author JingGe(* ^ ▽ ^ *)
 * @date 2023-03-06 16:00
 * @email 1158055613@qq.com
 */
@Getter
@Setter
public class StartOffset implements CacheData {
    private long startTimestamp;

    public StartOffset(String startTime) {
        try {
            Date start = DateUtils.parseDate(startTime, "yyyy-MM-dd", "yyyyMMdd", "yyyy-MM-dd HH:mm:ss");
            startTimestamp = start.getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public StartOffset(long startTimestamp) {
        this.startTimestamp = startTimestamp;
    }
}
